package com.item.controller;


import com.github.pagehelper.PageInfo;
import com.item.domain.UserPay;
import com.item.service.UserPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;

@RestController
public class UserPayController {

    @Autowired
    UserPayService userPaySerPayvice;

    @RequestMapping(value = "/findAll/{limit}/{page}")
    public PageInfo<List<UserPay>> findAll(@PathVariable int limit, @PathVariable int page) {
        List<UserPay> userPays = userPaySerPayvice.userFindAll(limit, page);
        PageInfo<List<UserPay>> pageInfo = new PageInfo<List<UserPay>>(Collections.singletonList(userPays));

        return pageInfo;
    }

}
